package com.example.demo;


import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/prefix")
public class QuickStartController {

    @GetMapping({"/quick"})
    public String quick() {
        return "访问成功";
    }

    @GetMapping({"/requestpara"})
    public String requestpara(@RequestParam Integer num) {
        return "para from request:" + num;
    }
    @GetMapping({"/para/{num}"})
    public String pathpara(@PathVariable Integer num){
        return "para from path:" + num;
    }

    @GetMapping({"/multiurl1","/multiurl2"})
    public String mul(@RequestParam Integer num){
        return "para from path:" + num;
    }

    @GetMapping({"/required"})
    public String required(@RequestParam(required = false,defaultValue = "0") Integer num) {
        return "para from request:" + num;
    }
}
